exports.dateFormat = function(v) {
  if (/^(-)?\d{1,10}$/.test(v)) {
    v = v * 1000;
  } else if (/^(-)?\d{1,13}$/.test(v)) {
    v = v * 1;
  }
  var dateObj = new Date(v);
  var month = dateObj.getMonth() + 1;
  var day = dateObj.getDate();
  var hours = dateObj.getHours();
  var minutes = dateObj.getMinutes();
  var seconds = dateObj.getSeconds();
  if (month < 10) {
    month = "0" + month;
  }
  if (day < 10) {
    day = "0" + day;
  }
  if (hours < 10) {
    hours = "0" + hours;
  }
  if (minutes < 10) {
    minutes = "0" + minutes;
  }
  if (seconds < 10) {
    seconds = "0" + seconds;
  }
  var UnixTimeToDate =
    dateObj.getFullYear() +
    "-" +
    month +
    "-" +
    day +
    " " +
    hours +
    "-" +
    minutes;
  return UnixTimeToDate;
};
